@import "./common/var";
@import "./mixins/mixins";
@import "mixins/utils";
@import "./mixins/_button";
// @import "./fonts/iconfont.css";

@include b(button) {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: $--color-white;
  border: $--border-base;
  border-color: $--border-color-base;
  color: $--color-text-base;
  -webkit-appearance: none;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  margin: 0;
  transition: .1s;
  font-weight: normal;

  @include utils-user-select(none);
  & + & {
    margin-left: 10px;
  }

  @include button-size($--button-padding-vertical, $--button-padding-horizontal, $--button-font-size, $--button-border-radius,$--button-width-min);

  .iconfont{
    font-size: inherit;
    & + span {
      margin-left: 6px;
    }
  }

  &:hover,
  &:focus {
    color: $--color-primary;
    border-color: $--color-primary;
    background-color: $--color-white;
  }

  &:active {
    color: $--color-white;
    border-color: $--color-primary;
    background-color: $--color-primary;
  }
  &.is-disabled {
    &,
    &:hover,
    &:focus,
    &:active {
      background-color: $--button-disabled-background-color;
      border: $--border-base;
      color: $--button-disabled-font-color;
    }
  }
  @include when(plain) {
    &:hover,
    &:focus {
      background: $--color-white;
      border-color: $--color-primary;;
      color: $--color-text-base;
    }

    &:active {
      background: $--color-white;
      border-color: $--color-primary;;
      color: $--color-primary;
      outline: none;
    }
  }
  @include when(hollow) {
    color: $--color-primary;
    &:hover,
    &:focus {
      background: $--color-white;
      border-color: $--color-primary;
      color: $--color-primary;
    }

    &:active {
      background: $--color-primary;
      border-color: $--color-primary;
      color: $--color-white;
      outline: none;
    }
  }

  @include when(round) {
    border-radius: 18px;
  }

  @include m(primary){
    @include button-variant($--button-primary-font-color, $--button-primary-background-color, $--button-primary-border-color);
    @include button-state(hover, #ffd8d8, $--color-primary, $--color-primary);
    @include button-state(focus, #ffd8d8, $--color-primary, $--color-primary);
    @include button-state(active, $--button-primary-font-color, #CA3725, #CA3725);
  }

  @include m(mini) {
    @include button-size($--button-mini-padding-vertical, $--button-mini-padding-horizontal, $--button-mini-font-size, $--button-mini-border-radius,$--button-mini-width-min)
  }

  @include m(small) {
    @include button-size($--button-small-padding-vertical, $--button-small-padding-horizontal, $--button-small-font-size, $--button-small-border-radius,$--button-small-width-min)
  }

  &.is-disabled {
    &,
    &:hover,
    &:focus,
    &:active {
      background-color: $--button-disabled-background-color;
      border: $--border-base;
      color: $--button-disabled-font-color;
    }
  }
}